package com.gryffonx.PlotGenerator;

import com.gryffonx.DiceRoller.StaticDiceRoller;

/**
 * **************************************************************************
 * Application:
 * Author: Erik Stell
 * Date: Sep 29, 2004
 * Time: 3:16:15 PM
 * Process:
 * **************************************************************************
 */
public class PlotSynopsisGenerator {

    public PlotSynopsisGenerator() {
    }

    private static void generatePlot() {
        String retVal = "";

        //roll a number based on the potential mileiu's
        int randomRoll = StaticDiceRoller.rolldSomething(2, 1);


        if (randomRoll == 1) {
            System.out.println("theme");

            //randomly pick a theme
            int themeRoll = StaticDiceRoller.rolldSomething(100, 1);
            if (themeRoll >= 1 && themeRoll <= 20) {
                System.out.println("Action");
                //randomly pick an action plotline
            } else if (themeRoll >= 21 && themeRoll <= 40) {
                System.out.println("Mystery");
                //randomly pick a mystery plotline
            } else if (themeRoll >= 41 && themeRoll <= 60) {
                System.out.println("Drama");
                //randomly pick a drama plotline
            } else if (themeRoll >= 61 && themeRoll <= 80) {
                System.out.println("Espionage");
                //randomly pick an espionage plotline
            } else if (themeRoll >= 81 && themeRoll <= 100) {
                System.out.println("Horror");
                //randomly pick a horror plotline
            }


        } else if (randomRoll == 2) {
            System.out.println("milieu");
            //randomly pick a milieu
            int milieuRoll = StaticDiceRoller.rolldSomething(100, 1);
            if (milieuRoll >= 1 && milieuRoll <= 17) {
                System.out.println("Peacetime");
                //randomly pick a peacetime plotline
            } else if (milieuRoll >= 18 && milieuRoll <= 33) {
                System.out.println("Strife");
                //randomly pick a strife plotline
            } else if (milieuRoll >= 34 && milieuRoll <= 50) {
                System.out.println("Disaster");
                //randomly pick a disaster plotline
            } else if (milieuRoll >= 51 && milieuRoll <= 67) {
                System.out.println("Upheaval");
                //randomly pick an upheaval plotline
            } else if (milieuRoll >= 68 && milieuRoll <= 84) {
                System.out.println("War");
                //randomly pick a war plotline
            } else if (milieuRoll >= 85 && milieuRoll <= 100) {
                System.out.println("Cataclysm");
                //randomly pick a cataclysm plotline
            }

            System.out.println(retVal);
        }
    }


    private String generateActionPlotline() {
        String retVal = "";

        int rollActionPlot = StaticDiceRoller.rolldSomething(100, 1);

        //get an xml structure of the plot elements

        //loop through the elements, testing the values of each elements
        //first and second attributes to fall within the range.  If true,
        //assign the third attribute to the retVal;


        return retVal;
    }

    private String generateMysteryPlotline() {
        String retVal = "";

        return retVal;
    }

    private String generateDramaPlotline() {
        String retVal = "";

        return retVal;
    }

    private String generateEspionagePlotline() {
        String retVal = "";

        return retVal;
    }

    private String generateHorrorPlotline() {
        String retVal = "";

        return retVal;
    }


    private String generatePeactimePlotline() {
        String retVal = "";

        //roll a random number for the plotline

        //correlate it back to the actions plotlines

        //get the information

        return retVal;
    }

    private String generateStrifePlotline() {
        String retVal = "";

        return retVal;
    }

    private String generateDisasterPlotline() {
        String retVal = "";

        return retVal;
    }

    private String generateUpheavalPlotline() {
        String retVal = "";

        return retVal;
    }

    private String generateWarPlotline() {
        String retVal = "";

        return retVal;
    }

    private String generateCataclysmPlotline() {
        String retVal = "";

        return retVal;
    }

    public static void main(String[] args) {
        generatePlot();
    }

}
